# $Id: PKGBUILD 182640 2013-04-11 22:29:15Z bisson $
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Angel Velasquez <angvp@archlinux.org> 
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: damir <damir@archlinux.org>
# Contributor: Daniel Bainton <dpb [at] backarrow.org>

pkgname=ncmpc
pkgver=0.21
pkgrel=1
pkgdesc='Fully featured MPD client using ncurses'
url='http://www.musicpd.org/clients/ncmpc/'
arch=('i686' 'x86_64')
license=('GPL')
depends=('ncurses' 'glib2' 'libmpdclient')
optdepends=('python2: to enable lyrics plugin'
            'ruby: to enable lyrics plugin')
source=("http://www.musicpd.org/download/${pkgname}/${pkgver%.*}/${pkgname}-${pkgver}.tar.bz2")
sha1sums=('ec828bf17be6ab4c60c39bc91a3bd5cd93fac4a5')

prepare() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	sed -e 's#python#python2#' -i lyrics/30-leoslyrics.py
}

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--enable-lyrics-screen \
		--with-lyrics-plugin-dir=/usr/share/ncmpc/lyrics
	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install
	for i in lyrics/*; do install -Dm755 "$i" "${pkgdir}/usr/share/ncmpc/$i"; done
}
